package com.buba.controller;

import com.buba.service.KudosService;
import entity.KudosEntity;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import result.CommonResult;

/**
 * @Author: 孔德嘉
 * @Description: TODO点赞
 * @DateTime: 2023/3/8 10:34
 **/
@RestController
@CrossOrigin
public class KudosController {
    //注入
    @Autowired
    private KudosService kudosService;

    /*
    * @param kudosWholeId 日记。话题id
     * @param kudosDictionaries 日记 话题类型  咨询是4
     * @param kudosUserId  点赞人id
    * @return result.CommonResult
    * @author kdj
    * @describe:修改点赞状态
    * @date 2023/3/8 10:41
    */
    @PutMapping("/updateKudosByUserId")
    public CommonResult updateKudosByUserId(@RequestBody KudosEntity kudosEntity){
        return CommonResult.ok(kudosService.updateKudosByUserId(kudosEntity));
    }
}
